 var url =window.location.search; //获取url中"?"符后的字串 
var theRequest = new Object(); 
var token;
var phoneNum;



	function jump(){
         phoneNum = Common.queryGetParam("phoneNum");
         token = Common.queryGetParam("token");

        if(!phoneNum){
            phoneNum = window.localStorage.getItem("phoneNum");
        }
        if(!token){
            token = window.localStorage.getItem("token");
        }
		var paramStr = {};
        paramStr.phoneNum=phoneNum;
        paramStr.token=token;
        var params = {};
        params.paramStr = JSON.stringify(paramStr);
        var result;
		$.ajax({
			headers: {"phone":phoneNum,"token":token},
	        method: "POST",
	        data:params,
	        url:'/fenful/api/v1/user/getUser',
	        datatype: "json",
	        success: function(re) { 
				var data=JSON.parse(re.data);
				var nickName=data.nickName;
				localStorage.setItem('nickName',nickName);
//				console.log(data.nickName)
				document.getElementById('uName').innerHTML=nickName; 
				
				document.getElementById('points').innerHTML=data.points
	        },
	        error: function(re) {
	          result=re;
	          
	        }
	    }) 
	   return result;
	   
	}


	if(localStorage.getItem("nickName")){
    	document.getElementById('available').className="availableMoney";
    }

     var links = document.querySelectorAll('a');
     Array.prototype.forEach.call(links, function (link) {
     	phoneNum=localStorage.getItem("phoneNum");
     	token=localStorage.getItem("token");
        link.addEventListener('click', function (e) {           	
            if(token&&phoneNum){           	 
            	 window.location.href=this.href;          	         	           
            }else{
            	e.preventDefault();
            	//window.location.href="/h5/#/login?huzhou";
                window.location.href=Common.WEB_PATH+"/fenful/h5/wzlh5/index.html";
            }                  
        })
    })
     

